package com;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component //这个注解就等价于  <bean id="user" class="com.pojo.User"/>
@Scope("singleton")//singleton为单例模式,或者为"prototype"原型模式
public class User {
    @Value("章鱼哥")  //这个注解就是给属性赋值的,等价于<property name="name" value="章鱼哥"/>
    public  String name;
}
